/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GeneradorDescktop.java
 *
 * Created on 28/09/2011, 11:01:24 PM
 */
package generadordescktop;

import generadorabm.Clase;
import generadorabm.Controladora;
import generadorabm.CreadoraClase;
import generadorabm.Metodo;
import generadorabm.OTablaAtributos;
import generadorabm.Parametro;
import generadorcommun.Atributo;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author agustin
 */
public class GeneradorDescktop extends javax.swing.JFrame {
    
    private static GeneradorDescktop instance;
    private String metodo = "";
    
    public static GeneradorDescktop getInstance() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
        if (instance == null) {
            instance = new GeneradorDescktop();
        }
        return instance;
    }
    
    public GeneradorDescktop() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
        instance = this;
        AtributosTableModel atributos = new AtributosTableModel();
        ExtiendeTableModel extiende = new ExtiendeTableModel();
        ImplementaTableModel implementa = new ImplementaTableModel();
        MetodosTableModel metodos = new MetodosTableModel();
        ParametrosTableModel parametros = new ParametrosTableModel("");
        initComponents();
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        SwingUtilities.updateComponentTreeUI(this);
        this.pack();
        this.setLocation(100, 100);
        
        lblNombreProyecto.setText(lblNombreProyecto.getText() + " " + Controladora.getInstance().getNombreProyecto());
        lblNombreProyecto1.setText(lblNombreProyecto.getText());
        cmbTipoListaParametro.setVisible(false);
        cmbTipoListaAtributo.setVisible(false);
        lblTipoLista.setVisible(false);
        lbltipoListaParametro.setVisible(false);
        cmbTipoRetornoLista.setVisible(false);
        lbltipoListaTipoRetorno.setVisible(false);
        ModeloComboTipoAtributos modeloCombo = new ModeloComboTipoAtributos();
        cmbTipoAtributoTipo.setModel(modeloCombo);
        ModeloComboTipoAtributos modeloCombo1 = new ModeloComboTipoAtributos();
        cmbTipoListaAtributo.setModel(modeloCombo1);
        ModeloComboTipoAtributos modeloCombo2 = new ModeloComboTipoAtributos();
        cmbTipoRetornoMetodo.setModel(modeloCombo2);
        ModeloComboTipoAtributos modeloCombo3 = new ModeloComboTipoAtributos();
        cmbTipoParametro.setModel(modeloCombo3);
        ModeloComboTipoAtributos modeloCombo4 = new ModeloComboTipoAtributos();
        cmbTipoListaParametro.setModel(modeloCombo4);
        ModeloComboImplementa modeloCombo5 = new ModeloComboImplementa();
        cmbImplementa.setModel(modeloCombo5);
        
        ModeloComboTipo modeloCombo6 = new ModeloComboTipo();
        cmbTipoAtributo.setModel(modeloCombo6);
        ModeloComboTipo modeloCombo7 = new ModeloComboTipo();
        cmbTipoMetodo.setModel(modeloCombo7);
        ModeloComboTipoAtributos modeloCombo8 = new ModeloComboTipoAtributos();
        cmbTipoRetornoLista.setModel(modeloCombo8);
        ModeloComboTipoClaseTipo modeloCombo9 = new ModeloComboTipoClaseTipo();
        cmbTipoClaseTipo.setModel(modeloCombo9);
        ModeloComboExtiende modeloCombo10 = new ModeloComboExtiende();
        cmbExtiende.setModel(modeloCombo10);
        
        rbtnBase.setSelected(true);
        rbtnSingleton.setSelected(false);
        
        tblAtributos.setModel(atributos);
        Controladora.getInstance().setAtributos(atributos);
        
        tblExtiende.setModel(extiende);
        Controladora.getInstance().setExtiende(extiende);
        
        tblImplementa.setModel(implementa);
        Controladora.getInstance().setImplemena(implementa);
        
        tblMetodos.setModel(metodos);
        Controladora.getInstance().setMetodos(metodos);
        
        tblParametros.setModel(parametros);
        Controladora.getInstance().setParametrosMetodos(parametros);
        
        if (Controladora.getInstance().getNombreProyecto().equals("")) {
            btnAgregarAtributo.setEnabled(false);
            btnAgregarClase.setEnabled(false);
            btnAgregarMetodo.setEnabled(false);
            btnAgregarParametro.setEnabled(false);
            btnNuevaClase.setEnabled(false);
            AgregarExtiende.setEnabled(false);
            AgregarImplementa.setEnabled(false);
            cmbExtiende.setSelectedItem(null);
            cmbImplementa.setSelectedItem(null);
            cmbTipoAtributo.setSelectedItem(null);
            cmbTipoAtributoTipo.setSelectedItem(null);
            
            cmbTipoClaseTipo.setSelectedItem(null);
            cmbTipoListaAtributo.setSelectedItem(null);
            cmbTipoListaParametro.setSelectedItem(null);
            cmbTipoMetodo.setSelectedItem(null);
            cmbTipoParametro.setSelectedItem(null);
            cmbTipoRetornoLista.setSelectedItem(null);
            cmbTipoRetornoMetodo.setSelectedItem(null);
            cmbExtiende.setEnabled(false);;
            cmbImplementa.setEnabled(false);
            cmbTipoAtributo.setEnabled(false);
            cmbTipoAtributoTipo.setEnabled(false);
            
            cmbTipoClaseTipo.setEnabled(false);
            cmbTipoListaAtributo.setEnabled(false);
            cmbTipoListaParametro.setEnabled(false);
            cmbTipoMetodo.setEnabled(false);
            cmbTipoParametro.setEnabled(false);
            cmbTipoRetornoLista.setEnabled(false);
            cmbTipoRetornoMetodo.setEnabled(false);
            txtNombreAtributo.setEnabled(false);
            txtNombreClase.setEnabled(false);
            txtNombreMetodo.setEnabled(false);
            txtNombreParametro.setEnabled(false);
            rbtnAbstract.setEnabled(false);
            rbtnBase.setEnabled(false);
            rbtnSingleton.setEnabled(false);
        }
        setEventoMouseClicked();
        setEventoMouseClickedExtiende();
        setEventoMouseClickedImplementa();
        setEventoMouseClickedMetodo();
        setEventoMouseClickedParametrosMetodo();
    }
    
    private void setEventoMouseClicked() {
        
        tblAtributos.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblAtributosMouseClicked(e);
            }
        });
    }
    
    private void setEventoMouseClickedExtiende() {
        
        tblExtiende.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblExtiendeMouseClicked(e);
            }
        });
    }
    
    private void setEventoMouseClickedImplementa() {
        
        tblImplementa.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblImplementaMouseClicked(e);
            }
        });
    }
    
    private void setEventoMouseClickedMetodo() {
        
        tblMetodos.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblMetodoMouseClicked(e);
            }
        });
    }
    
    private void setEventoMouseClickedParametrosMetodo() {
        
        tblParametros.addMouseListener(new java.awt.event.MouseAdapter() {
            
            @Override
            public void mouseClicked(MouseEvent e) {
                tblParametrosMetodoMouseClicked(e);
            }
        });
    }
    
    private void tblAtributosMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblAtributos.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblAtributos.isEnabled()) {
            for (int i = 0; i < tblAtributos.getColumnCount(); i++) {
                cadena = cadena + " " + tblAtributos.getModel().getValueAt(row, i).toString();
                System.out.println(cadena);
                Atributo atributo = (Atributo) this.tblAtributos.getModel().getValueAt(row, i);
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getAtributos().size(); z++) {
//                    if(Controladora.getInstance().getCreadoraClase().getAtributos().get(z).equals(cadena)){
                    Controladora.getInstance().getCreadoraClase().getAtributos().remove(atributo);
//                    }

                }
            }
        }
        actualizarAtributo();
        
    }
    
    private void tblExtiendeMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblExtiende.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblExtiende.isEnabled()) {
            for (int i = 0; i < tblExtiende.getColumnCount(); i++) {
                cadena = cadena + " " + tblExtiende.getModel().getValueAt(row, i).toString();
                System.out.println(cadena);
                String clase = (String) this.tblExtiende.getModel().getValueAt(row, i);
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getClase().getExtiende().size(); z++) {
//                    if(Controladora.getInstance().getCreadoraClase().getAtributos().get(z).equals(cadena)){
                    Controladora.getInstance().getCreadoraClase().getClase().getExtiende().remove(clase);
//                    }

                }
            }
        }
        actualizarExtiende();
        
    }
    
    private void tblImplementaMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblImplementa.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblImplementa.isEnabled()) {
            for (int i = 0; i < tblImplementa.getColumnCount(); i++) {
                cadena = cadena + " " + tblImplementa.getModel().getValueAt(row, i).toString();
                System.out.println(cadena);
                String clase = (String) this.tblImplementa.getModel().getValueAt(row, i);
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getClase().getImplementa().size(); z++) {
//                    if(Controladora.getInstance().getCreadoraClase().getAtributos().get(z).equals(cadena)){
                    Controladora.getInstance().getCreadoraClase().getClase().getImplementa().remove(clase);
//                    }

                }
            }
        }
        actualizarImplementa();
        
    }
    
    private void tblMetodoMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblMetodos.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblMetodos.isEnabled()) {
            for (int i = 0; i < tblMetodos.getColumnCount(); i++) {
                cadena = cadena + " " + tblMetodos.getModel().getValueAt(row, i).toString();
                System.out.println(cadena);
                Metodo clase = (Metodo) this.tblMetodos.getModel().getValueAt(row, i);
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getMetodos().size(); z++) {
                    if (rbtnQuitarMetodo.isSelected()) {
                        Controladora.getInstance().getCreadoraClase().getMetodos().remove(clase);
                    } else {
                        metodo = clase.getNombre();
                        actualizarParametrosMetodos();
                    }
                }
            }
        }
        actualizarMetodos();
        
    }
    
    private void tblParametrosMetodoMouseClicked(java.awt.event.MouseEvent evt) {
        String cadena = "";
        int row = this.tblParametros.rowAtPoint(evt.getPoint());
        if (row >= 0 && tblParametros.isEnabled()) {
            for (int i = 0; i < tblParametros.getColumnCount(); i++) {
                cadena = cadena + " " + tblParametros.getModel().getValueAt(row, i).toString();
                System.out.println(cadena);
                Parametro clase = (Parametro) this.tblParametros.getModel().getValueAt(row, i);
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getMetodos().size(); z++) {
                    if (metodo.equals(Controladora.getInstance().getCreadoraClase().getMetodos().get(z).getNombre())) {
                        Controladora.getInstance().getCreadoraClase().getMetodos().get(z).getParametros().remove(clase);
                    }
                }
            }
        }
        actualizarParametrosMetodos();
        
    }
    
    public void actualizarAtributo() {
        AtributosTableModel tbmlAtributo = new AtributosTableModel();
        tblAtributos.setModel(tbmlAtributo);
        Controladora.getInstance().setAtributos(tbmlAtributo);
    }
    
    public void actualizarExtiende() {
        ExtiendeTableModel tbmlExtiende = new ExtiendeTableModel();
        tblExtiende.setModel(tbmlExtiende);
        Controladora.getInstance().setExtiende(tbmlExtiende);
    }
    
    public void actualizarImplementa() {
        ImplementaTableModel tbmlImplementa = new ImplementaTableModel();
        tblImplementa.setModel(tbmlImplementa);
    }
    
    public void actualizarMetodos() {
        MetodosTableModel tbmlMetodos = new MetodosTableModel();
        tblMetodos.setModel(tbmlMetodos);
    }
    
    public void actualizarParametrosMetodos() {
        ParametrosTableModel tbmlParametros = new ParametrosTableModel(metodo);
        tblParametros.setModel(tbmlParametros);
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jtpMenu = new javax.swing.JTabbedPane();
        jClase = new javax.swing.JPanel();
        cmbExtiende = new javax.swing.JComboBox();
        txtNombreClase = new javax.swing.JTextField();
        cmbImplementa = new javax.swing.JComboBox();
        lblNombreClase = new javax.swing.JLabel();
        btnAgregarClase = new javax.swing.JButton();
        btnNuevaClase = new javax.swing.JButton();
        lblNombreProyecto = new javax.swing.JLabel();
        lblTIpoClase = new javax.swing.JLabel();
        lblExtiendeClase = new javax.swing.JLabel();
        lblImplementaClase = new javax.swing.JLabel();
        lblTIpoClase1 = new javax.swing.JLabel();
        cmbTipoClaseTipo = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblExtiende = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblImplementa = new javax.swing.JTable();
        rbtnSingleton = new javax.swing.JRadioButton();
        rbtnBase = new javax.swing.JRadioButton();
        AgregarExtiende = new javax.swing.JButton();
        AgregarImplementa = new javax.swing.JButton();
        lblPublic = new javax.swing.JLabel();
        jAtributo = new javax.swing.JPanel();
        cmbTipoAtributoTipo = new javax.swing.JComboBox();
        btnAgregarAtributo = new javax.swing.JButton();
        txtNombreAtributo = new javax.swing.JTextField();
        cmbTipoAtributo = new javax.swing.JComboBox();
        lblTipo = new javax.swing.JLabel();
        lblNombreAtributo1 = new javax.swing.JLabel();
        cmbTipoListaAtributo = new javax.swing.JComboBox();
        lblTipo1 = new javax.swing.JLabel();
        lblNombreProyecto1 = new javax.swing.JLabel();
        lblTipoLista = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tblAtributos = new javax.swing.JTable();
        jMetodos = new javax.swing.JPanel();
        cmbTipoMetodo = new javax.swing.JComboBox();
        cmbTipoRetornoMetodo = new javax.swing.JComboBox();
        txtNombreMetodo = new javax.swing.JTextField();
        lblNombreMetodo = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tblMetodos = new javax.swing.JTable();
        jScrollPane5 = new javax.swing.JScrollPane();
        tblParametros = new javax.swing.JTable();
        txtNombreParametro = new javax.swing.JTextField();
        lblNombreParametro = new javax.swing.JLabel();
        lblTipoParametro = new javax.swing.JLabel();
        sepMetodos = new javax.swing.JSeparator();
        btnAgregarMetodo = new javax.swing.JButton();
        btnAgregarParametro = new javax.swing.JButton();
        cmbTipoParametro = new javax.swing.JComboBox();
        cmbTipoListaParametro = new javax.swing.JComboBox();
        lblNombreMetodo2 = new javax.swing.JLabel();
        lblNombreMetodo3 = new javax.swing.JLabel();
        lbltipoListaParametro = new javax.swing.JLabel();
        cmbTipoRetornoLista = new javax.swing.JComboBox();
        lbltipoListaTipoRetorno = new javax.swing.JLabel();
        rbtnAbstract = new javax.swing.JRadioButton();
        rbtnQuitarMetodo = new javax.swing.JRadioButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jAbrir = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jNuevo = new javax.swing.JMenu();
        jmiNuevoProyecto = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jtpMenu.setName("jtpMenu"); // NOI18N

        jClase.setName("jClase"); // NOI18N
        jClase.setPreferredSize(new java.awt.Dimension(500, 387));

        cmbExtiende.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Extiende" }));
        cmbExtiende.setName("cmbExtiende"); // NOI18N

        txtNombreClase.setName("txtNombreClase"); // NOI18N

        cmbImplementa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Implementa" }));
        cmbImplementa.setName("cmbImplementa"); // NOI18N

        lblNombreClase.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreClase.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreClase.setText("Nombre Clase");
        lblNombreClase.setName("lblNombreClase"); // NOI18N

        btnAgregarClase.setText("Generar");
        btnAgregarClase.setName("btnAgregarClase"); // NOI18N
        btnAgregarClase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarClaseActionPerformed(evt);
            }
        });

        btnNuevaClase.setText("Limpiar");
        btnNuevaClase.setName("btnNuevaClase"); // NOI18N
        btnNuevaClase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevaClaseActionPerformed(evt);
            }
        });

        lblNombreProyecto.setFont(new java.awt.Font("Ubuntu", 0, 24));
        lblNombreProyecto.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreProyecto.setText("Proyecto: ");
        lblNombreProyecto.setName("lblNombreProyecto"); // NOI18N

        lblTIpoClase.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTIpoClase.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTIpoClase.setText("Tipo Clase");
        lblTIpoClase.setName("lblTIpoClase"); // NOI18N

        lblExtiendeClase.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblExtiendeClase.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblExtiendeClase.setText("Extiende");
        lblExtiendeClase.setName("lblExtiendeClase"); // NOI18N

        lblImplementaClase.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblImplementaClase.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblImplementaClase.setText("Implementa");
        lblImplementaClase.setName("lblImplementaClase"); // NOI18N

        lblTIpoClase1.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTIpoClase1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTIpoClase1.setText("Tipo ");
        lblTIpoClase1.setName("lblTIpoClase1"); // NOI18N

        cmbTipoClaseTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TipoClase" }));
        cmbTipoClaseTipo.setName("cmbTipoClaseTipo"); // NOI18N
        cmbTipoClaseTipo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cmbTipoClaseTipoItemStateChanged(evt);
            }
        });
        cmbTipoClaseTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbTipoClaseTipoActionPerformed(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tblExtiende.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tblExtiende.setName("tblExtiende"); // NOI18N
        jScrollPane1.setViewportView(tblExtiende);

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        tblImplementa.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tblImplementa.setName("tblImplementa"); // NOI18N
        jScrollPane2.setViewportView(tblImplementa);

        rbtnSingleton.setText("Singleton");
        rbtnSingleton.setName("rbtnSingleton"); // NOI18N

        rbtnBase.setText("Crear Base ");
        rbtnBase.setName("rbtnBase"); // NOI18N

        AgregarExtiende.setText("Agregar");
        AgregarExtiende.setName("AgregarExtiende"); // NOI18N
        AgregarExtiende.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AgregarExtiendeActionPerformed(evt);
            }
        });

        AgregarImplementa.setText("Agregar");
        AgregarImplementa.setName("AgregarImplementa"); // NOI18N
        AgregarImplementa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AgregarImplementaActionPerformed(evt);
            }
        });

        lblPublic.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblPublic.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblPublic.setText("public");
        lblPublic.setName("lblPublic"); // NOI18N

        javax.swing.GroupLayout jClaseLayout = new javax.swing.GroupLayout(jClase);
        jClase.setLayout(jClaseLayout);
        jClaseLayout.setHorizontalGroup(
            jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jClaseLayout.createSequentialGroup()
                .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lblTIpoClase1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(rbtnBase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(rbtnSingleton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnAgregarClase, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                            .addComponent(btnNuevaClase, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(16, 16, 16)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(lblTIpoClase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(cmbTipoClaseTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(10, 10, 10)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 345, Short.MAX_VALUE))
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblNombreProyecto, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jClaseLayout.createSequentialGroup()
                                .addGap(32, 32, 32)
                                .addComponent(lblPublic, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(229, 229, 229)
                                .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(lblExtiendeClase, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jClaseLayout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(AgregarExtiende, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
                                            .addComponent(cmbExtiende, 0, 147, Short.MAX_VALUE))))
                                .addGap(18, 18, 18)
                                .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblImplementaClase, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                    .addGroup(jClaseLayout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(cmbImplementa, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(AgregarImplementa, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))))))))
                .addGap(62, 62, 62))
        );
        jClaseLayout.setVerticalGroup(
            jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jClaseLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblNombreProyecto)
                .addGap(2, 2, 2)
                .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblTIpoClase)
                            .addComponent(lblTIpoClase1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtNombreClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cmbTipoClaseTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblPublic)))
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblExtiendeClase)
                            .addComponent(lblImplementaClase))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmbExtiende, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cmbImplementa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(AgregarExtiende)
                            .addComponent(AgregarImplementa))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jClaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE)))
                    .addGroup(jClaseLayout.createSequentialGroup()
                        .addGap(57, 57, 57)
                        .addComponent(rbtnSingleton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rbtnBase)
                        .addGap(18, 18, 18)
                        .addComponent(btnAgregarClase, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnNuevaClase, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jtpMenu.addTab("Clase", jClase);

        jAtributo.setName("jAtributo"); // NOI18N

        cmbTipoAtributoTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo" }));
        cmbTipoAtributoTipo.setName("cmbTipoAtributoTipo"); // NOI18N
        cmbTipoAtributoTipo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cmbTipoAtributoTipoItemStateChanged(evt);
            }
        });

        btnAgregarAtributo.setText("Agregar");
        btnAgregarAtributo.setName("btnAgregarAtributo"); // NOI18N
        btnAgregarAtributo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarAtributoActionPerformed(evt);
            }
        });

        txtNombreAtributo.setName("txtNombreAtributo"); // NOI18N

        cmbTipoAtributo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TipoAtributo" }));
        cmbTipoAtributo.setName("cmbTipoAtributo"); // NOI18N

        lblTipo.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTipo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTipo.setText("Tipo");
        lblTipo.setName("lblTipo"); // NOI18N

        lblNombreAtributo1.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreAtributo1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreAtributo1.setText("Nombre Atributo");
        lblNombreAtributo1.setName("lblNombreAtributo1"); // NOI18N

        cmbTipoListaAtributo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo" }));
        cmbTipoListaAtributo.setName("cmbTipoListaAtributo"); // NOI18N

        lblTipo1.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTipo1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTipo1.setText("Tipo Atributo");
        lblTipo1.setName("lblTipo1"); // NOI18N

        lblNombreProyecto1.setFont(new java.awt.Font("Ubuntu", 0, 24));
        lblNombreProyecto1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreProyecto1.setText("Proyecto: ");
        lblNombreProyecto1.setName("lblNombreProyecto1"); // NOI18N

        lblTipoLista.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTipoLista.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTipoLista.setText("Tipo Lista");
        lblTipoLista.setName("lblTipoLista"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        tblAtributos.setModel(new  AtributosTableModel());
        tblAtributos.setColumnSelectionAllowed(true);
        tblAtributos.setName("tblAtributos"); // NOI18N
        jScrollPane3.setViewportView(tblAtributos);

        javax.swing.GroupLayout jAtributoLayout = new javax.swing.GroupLayout(jAtributo);
        jAtributo.setLayout(jAtributoLayout);
        jAtributoLayout.setHorizontalGroup(
            jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jAtributoLayout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addGroup(jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lblTipo1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                            .addComponent(cmbTipoAtributo, javax.swing.GroupLayout.Alignment.LEADING, 0, 158, Short.MAX_VALUE)
                            .addComponent(cmbTipoAtributoTipo, 0, 158, Short.MAX_VALUE)
                            .addComponent(lblTipo, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                            .addComponent(lblTipoLista, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                            .addComponent(cmbTipoListaAtributo, javax.swing.GroupLayout.Alignment.LEADING, 0, 158, Short.MAX_VALUE)
                            .addComponent(lblNombreAtributo1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))
                        .addComponent(txtNombreAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jAtributoLayout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(btnAgregarAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(71, 71, 71)
                .addGroup(jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
                    .addComponent(lblNombreProyecto1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE))
                .addContainerGap())
        );
        jAtributoLayout.setVerticalGroup(
            jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jAtributoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblNombreProyecto1)
                .addGap(8, 8, 8)
                .addGroup(jAtributoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jAtributoLayout.createSequentialGroup()
                        .addComponent(lblTipo1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cmbTipoAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(lblTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cmbTipoAtributoTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(14, 14, 14)
                        .addComponent(lblTipoLista, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cmbTipoListaAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(lblNombreAtributo1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtNombreAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(37, 37, 37)
                        .addComponent(btnAgregarAtributo, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE))
                .addContainerGap())
        );

        jtpMenu.addTab("Atributos", jAtributo);

        jMetodos.setAutoscrolls(true);
        jMetodos.setName("jMetodos"); // NOI18N

        cmbTipoMetodo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo" }));
        cmbTipoMetodo.setName("cmbTipoMetodo"); // NOI18N

        cmbTipoRetornoMetodo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TipoRetorno" }));
        cmbTipoRetornoMetodo.setName("cmbTipoRetornoMetodo"); // NOI18N
        cmbTipoRetornoMetodo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cmbTipoRetornoMetodoItemStateChanged(evt);
            }
        });

        txtNombreMetodo.setName("txtNombreMetodo"); // NOI18N

        lblNombreMetodo.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreMetodo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreMetodo.setText("Nombre Metodo");
        lblNombreMetodo.setName("lblNombreMetodo"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        tblMetodos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tblMetodos.setName("tblMetodos"); // NOI18N
        jScrollPane4.setViewportView(tblMetodos);

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        tblParametros.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tblParametros.setName("tblParametros"); // NOI18N
        jScrollPane5.setViewportView(tblParametros);

        txtNombreParametro.setName("txtNombreParametro"); // NOI18N

        lblNombreParametro.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreParametro.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreParametro.setText("Nombre Parametro");
        lblNombreParametro.setName("lblNombreParametro"); // NOI18N

        lblTipoParametro.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblTipoParametro.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblTipoParametro.setText("Tipo Parametro");
        lblTipoParametro.setName("lblTipoParametro"); // NOI18N

        sepMetodos.setName("sepMetodos"); // NOI18N

        btnAgregarMetodo.setText("+");
        btnAgregarMetodo.setName("btnAgregarMetodo"); // NOI18N
        btnAgregarMetodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarMetodoActionPerformed(evt);
            }
        });

        btnAgregarParametro.setText("+");
        btnAgregarParametro.setName("btnAgregarParametro"); // NOI18N
        btnAgregarParametro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarParametroActionPerformed(evt);
            }
        });

        cmbTipoParametro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo" }));
        cmbTipoParametro.setName("cmbTipoParametro"); // NOI18N
        cmbTipoParametro.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cmbTipoParametroItemStateChanged(evt);
            }
        });

        cmbTipoListaParametro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tipo" }));
        cmbTipoListaParametro.setName("cmbTipoListaParametro"); // NOI18N

        lblNombreMetodo2.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreMetodo2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreMetodo2.setText("Tipo");
        lblNombreMetodo2.setName("lblNombreMetodo2"); // NOI18N

        lblNombreMetodo3.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lblNombreMetodo3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblNombreMetodo3.setText("TipoRetorno");
        lblNombreMetodo3.setName("lblNombreMetodo3"); // NOI18N

        lbltipoListaParametro.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lbltipoListaParametro.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbltipoListaParametro.setText("TipoLista");
        lbltipoListaParametro.setName("lbltipoListaParametro"); // NOI18N

        cmbTipoRetornoLista.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TipoRetorno" }));
        cmbTipoRetornoLista.setName("cmbTipoRetornoLista"); // NOI18N

        lbltipoListaTipoRetorno.setFont(new java.awt.Font("Ubuntu", 0, 14));
        lbltipoListaTipoRetorno.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbltipoListaTipoRetorno.setText("TipoLista");
        lbltipoListaTipoRetorno.setName("lbltipoListaTipoRetorno"); // NOI18N

        rbtnAbstract.setText("Abstract");
        rbtnAbstract.setName("rbtnAbstract"); // NOI18N

        rbtnQuitarMetodo.setText("Quitar Metodo");
        rbtnQuitarMetodo.setName("rbtnQuitarMetodo"); // NOI18N

        javax.swing.GroupLayout jMetodosLayout = new javax.swing.GroupLayout(jMetodos);
        jMetodos.setLayout(jMetodosLayout);
        jMetodosLayout.setHorizontalGroup(
            jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMetodosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jMetodosLayout.createSequentialGroup()
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(rbtnAbstract, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                            .addComponent(cmbTipoMetodo, javax.swing.GroupLayout.Alignment.LEADING, 0, 152, Short.MAX_VALUE)
                            .addComponent(lblNombreParametro, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                            .addComponent(txtNombreParametro, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                            .addComponent(lblTipoParametro, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                            .addComponent(txtNombreMetodo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                            .addComponent(cmbTipoParametro, javax.swing.GroupLayout.Alignment.LEADING, 0, 152, Short.MAX_VALUE)
                            .addComponent(cmbTipoRetornoMetodo, 0, 152, Short.MAX_VALUE)
                            .addComponent(cmbTipoListaParametro, javax.swing.GroupLayout.Alignment.LEADING, 0, 152, Short.MAX_VALUE)
                            .addComponent(cmbTipoRetornoLista, javax.swing.GroupLayout.Alignment.LEADING, 0, 152, Short.MAX_VALUE)
                            .addComponent(lblNombreMetodo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnAgregarParametro, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(lbltipoListaParametro, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(lblNombreMetodo2, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(lblNombreMetodo3, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(btnAgregarMetodo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(rbtnQuitarMetodo, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(lbltipoListaTipoRetorno, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(sepMetodos, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE))
                .addContainerGap())
        );
        jMetodosLayout.setVerticalGroup(
            jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMetodosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                    .addGroup(jMetodosLayout.createSequentialGroup()
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmbTipoMetodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblNombreMetodo2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(rbtnAbstract, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(7, 7, 7)
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jMetodosLayout.createSequentialGroup()
                                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(cmbTipoRetornoMetodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblNombreMetodo3))
                                .addGap(49, 49, 49)
                                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lblNombreMetodo)
                                    .addComponent(btnAgregarMetodo, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(txtNombreMetodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(rbtnQuitarMetodo)))
                            .addGroup(jMetodosLayout.createSequentialGroup()
                                .addGap(41, 41, 41)
                                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(cmbTipoRetornoLista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbltipoListaTipoRetorno))))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(sepMetodos, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jMetodosLayout.createSequentialGroup()
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblNombreParametro)
                            .addComponent(btnAgregarParametro, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNombreParametro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblTipoParametro)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cmbTipoParametro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jMetodosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbltipoListaParametro)
                            .addComponent(cmbTipoListaParametro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE))
                .addContainerGap())
        );

        jtpMenu.addTab("Metodos", jMetodos);

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jAbrir.setText("Abrir");
        jAbrir.setName("jAbrir"); // NOI18N
        jAbrir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAbrirActionPerformed(evt);
            }
        });

        jMenuItem1.setText("Abrir Proyecto");
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jAbrir.add(jMenuItem1);

        jMenuBar1.add(jAbrir);

        jNuevo.setText("Nuevo");
        jNuevo.setName("jNuevo"); // NOI18N

        jmiNuevoProyecto.setText("Nuevo Proyecto");
        jmiNuevoProyecto.setName("jmiNuevoProyecto"); // NOI18N
        jmiNuevoProyecto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiNuevoProyectoActionPerformed(evt);
            }
        });
        jNuevo.add(jmiNuevoProyecto);

        jMenuBar1.add(jNuevo);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jtpMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 725, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jtpMenu, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnAgregarMetodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarMetodoActionPerformed
    if (cmbTipoMetodo.getSelectedItem() != null && cmbTipoRetornoMetodo.getSelectedItem() != null && !txtNombreMetodo.getText().equals("")) {
        Metodo metodo = new Metodo();
        metodo.setNombre(txtNombreMetodo.getText());
        metodo.setTipo(cmbTipoMetodo.getSelectedItem().toString());
        
        if (cmbTipoRetornoMetodo.getSelectedItem() != null) {
            if (cmbTipoRetornoMetodo.getSelectedItem().toString().equals("Ninguno")) {
                metodo.setTipoRetorno("");
                if (cmbTipoClaseTipo.getSelectedItem().toString().toLowerCase().equals("interface")) {
                    metodo.setTipoMetodo("interface");
                } else {
                    if (rbtnAbstract.isSelected()) {
                        metodo.setTipoMetodo("abstract");
                    } else {
                        metodo.setTipoMetodo("");
                    }
                }

//                metodo.setTipoMetodo("PROCES");
                Controladora.getInstance().getCreadoraClase().setMetodos(metodo);
                cmbTipoMetodo.setSelectedItem(null);
                cmbTipoRetornoMetodo.setSelectedItem(null);
                cmbTipoRetornoLista.setSelectedItem(null);
                txtNombreMetodo.setText("");
                rbtnAbstract.setSelected(false);
                
                
            } else {
                if (cmbTipoRetornoMetodo.getSelectedItem().toString().equals("List")) {
                    if (cmbTipoRetornoLista.getSelectedItem() != null) {
                        metodo.setTipoRetorno("List<" + cmbTipoRetornoLista.getSelectedItem().toString() + ">");
                        if (rbtnAbstract.isSelected()) {
                            metodo.setTipoMetodo("abstract");
                        } else {
                            metodo.setTipoMetodo("");
                        }
                        Controladora.getInstance().getCreadoraClase().setMetodos(metodo);
                        cmbTipoMetodo.setSelectedItem(null);
                        cmbTipoRetornoMetodo.setSelectedItem(null);
                        cmbTipoRetornoLista.setSelectedItem(null);
                        txtNombreMetodo.setText("");
                        rbtnAbstract.setSelected(false);
                    }
                } else {
                    metodo.setTipoRetorno(cmbTipoRetornoMetodo.getSelectedItem().toString());
                    if (rbtnAbstract.isSelected()) {
                        metodo.setTipoMetodo("ABSTRACT");
                    } else {
                        metodo.setTipoMetodo("");
                    }
                    Controladora.getInstance().getCreadoraClase().setMetodos(metodo);
                    cmbTipoMetodo.setSelectedItem(null);
                    cmbTipoRetornoMetodo.setSelectedItem(null);
                    cmbTipoRetornoLista.setSelectedItem(null);
                    txtNombreMetodo.setText("");
                    rbtnAbstract.setSelected(false);
                }
            }
        }
    }
    cmbTipoRetornoLista.setVisible(false);    
    lbltipoListaTipoRetorno.setVisible(false);
}//GEN-LAST:event_btnAgregarMetodoActionPerformed
    
private void btnAgregarParametroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarParametroActionPerformed
    
    if (!txtNombreParametro.getText().equals("") && cmbTipoParametro.getSelectedItem() != null) {
        Parametro parametro = new Parametro();
        parametro.setNombre(txtNombreParametro.getText());
        
        if (!cmbTipoParametro.getSelectedItem().toString().equals("Ninguno")) {
            if (cmbTipoParametro.getSelectedItem().toString().equals("List")) {
                if (cmbTipoListaParametro.getSelectedItem() != null) {
                    parametro.setTipo("List<" + cmbTipoListaParametro.getSelectedItem().toString() + ">");
                    for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getMetodos().size(); z++) {
                        if (metodo.equals(Controladora.getInstance().getCreadoraClase().getMetodos().get(z).getNombre())) {
                            Controladora.getInstance().getCreadoraClase().getMetodos().get(z).setParametros(parametro);
                            txtNombreParametro.setText("");
                            cmbTipoListaParametro.setSelectedItem(null);
                            cmbTipoParametro.setSelectedItem(null);
                            
                        }
                    }
                }
            } else {
                parametro.setTipo(cmbTipoParametro.getSelectedItem().toString());
                for (int z = 0; z < Controladora.getInstance().getCreadoraClase().getMetodos().size(); z++) {
                    if (metodo.equals(Controladora.getInstance().getCreadoraClase().getMetodos().get(z).getNombre())) {
                        Controladora.getInstance().getCreadoraClase().getMetodos().get(z).setParametros(parametro);
                    }
                }
                
            }
        }
        actualizarParametrosMetodos();
        cmbTipoListaParametro.setVisible(false);
        lbltipoListaParametro.setVisible(false);
    }
}//GEN-LAST:event_btnAgregarParametroActionPerformed
private void jmiNuevoProyectoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiNuevoProyectoActionPerformed
    this.dispose();
    CrearProyectoNuevo nuevo = null;
    try {
        nuevo = new CrearProyectoNuevo();
        
        
    } catch (ClassNotFoundException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    }
    nuevo.setVisible(true);
}//GEN-LAST:event_jmiNuevoProyectoActionPerformed
    
private void cmbTipoAtributoTipoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbTipoAtributoTipoItemStateChanged
    if (cmbTipoAtributoTipo.getSelectedItem() != null) {
        if (cmbTipoAtributoTipo.getSelectedItem().toString().equals("List")) {
            cmbTipoListaAtributo.setVisible(true);
            lblTipoLista.setVisible(true);
        } else {
            cmbTipoListaAtributo.setVisible(false);
            lblTipoLista.setVisible(false);
        }
    }
}//GEN-LAST:event_cmbTipoAtributoTipoItemStateChanged
    
private void cmbTipoParametroItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbTipoParametroItemStateChanged
    if (cmbTipoParametro.getSelectedItem() != null) {
        if (cmbTipoParametro.getSelectedItem().toString().equals("List")) {
            cmbTipoListaParametro.setVisible(true);
            lbltipoListaParametro.setVisible(true);
        } else {
            cmbTipoListaParametro.setVisible(false);
            lbltipoListaParametro.setVisible(false);
        }
    }
}//GEN-LAST:event_cmbTipoParametroItemStateChanged
private void cmbTipoRetornoMetodoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbTipoRetornoMetodoItemStateChanged
    if (cmbTipoRetornoMetodo.getSelectedItem() != null) {
        if (cmbTipoRetornoMetodo.getSelectedItem().toString().equals("List")) {
            cmbTipoRetornoLista.setVisible(true);
            lbltipoListaTipoRetorno.setVisible(true);
        } else {
            cmbTipoRetornoLista.setVisible(false);
            lbltipoListaTipoRetorno.setVisible(false);
        }
    }
}//GEN-LAST:event_cmbTipoRetornoMetodoItemStateChanged
    
private void jAbrirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAbrirActionPerformed
}//GEN-LAST:event_jAbrirActionPerformed
    
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
    this.dispose();
    AbrirProyecto nuevo = null;
    try {
        nuevo = new AbrirProyecto();
        
        
        
        
    } catch (ClassNotFoundException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
    }
    nuevo.setVisible(true);
}//GEN-LAST:event_jMenuItem1ActionPerformed
    
private void btnAgregarClaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarClaseActionPerformed
    if (cmbTipoClaseTipo.getSelectedItem() != null && !txtNombreClase.getText().equals("")) {
        boolean singleton = false;
        boolean basededatos = true;
        if (rbtnSingleton.isSelected()) {
            singleton = true;
        }
        if (!rbtnBase.isSelected()) {
            basededatos = false;
        }
        try {
            Controladora.getInstance().getCreadoraClase().getClase().setNombre(txtNombreClase.getText());
            Controladora.getInstance().getCreadoraClase().getClase().setTipoClase(cmbTipoClaseTipo.getSelectedItem().toString());
            Controladora.getInstance().getCreadoraClase().setClase(Controladora.getInstance().getCreadoraClase().getClase());
            Controladora.getInstance().getCreadoraClase().generarCodigo(singleton, basededatos);
            
            
            
            
        } catch (IOException ex) {
            Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    limpiar();
}//GEN-LAST:event_btnAgregarClaseActionPerformed
    
private void btnNuevaClaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevaClaseActionPerformed
    limpiar();
    
}//GEN-LAST:event_btnNuevaClaseActionPerformed
    public void limpiar() {
        CreadoraClase clase = new CreadoraClase(Controladora.getInstance().getNombreProyecto());
        Controladora.getInstance().setCreadoraClase(clase);
        Controladora.getInstance().getCreadoraClase().limpiar();
        txtNombreAtributo.setText("");
        txtNombreClase.setText("");
        txtNombreMetodo.setText("");
        txtNombreParametro.setText("");
        ModeloComboTipoAtributos modeloCombo = new ModeloComboTipoAtributos();
        cmbTipoAtributoTipo.setModel(modeloCombo);
        ModeloComboTipoAtributos modeloCombo1 = new ModeloComboTipoAtributos();
        cmbTipoListaAtributo.setModel(modeloCombo1);
        ModeloComboTipoAtributos modeloCombo2 = new ModeloComboTipoAtributos();
        cmbTipoRetornoMetodo.setModel(modeloCombo2);
        ModeloComboTipoAtributos modeloCombo3 = new ModeloComboTipoAtributos();
        cmbTipoParametro.setModel(modeloCombo3);
        ModeloComboTipoAtributos modeloCombo4 = new ModeloComboTipoAtributos();
        cmbTipoListaParametro.setModel(modeloCombo4);
        ModeloComboImplementa modeloCombo5 = new ModeloComboImplementa();
        cmbImplementa.setModel(modeloCombo5);
        
        ModeloComboTipo modeloCombo6 = new ModeloComboTipo();
        cmbTipoAtributo.setModel(modeloCombo6);
        ModeloComboTipo modeloCombo7 = new ModeloComboTipo();
        cmbTipoMetodo.setModel(modeloCombo7);
        ModeloComboTipoAtributos modeloCombo8 = new ModeloComboTipoAtributos();
        cmbTipoRetornoLista.setModel(modeloCombo8);
        ModeloComboTipoClaseTipo modeloCombo9 = new ModeloComboTipoClaseTipo();
        cmbTipoClaseTipo.setModel(modeloCombo9);
        ModeloComboExtiende modeloCombo10 = new ModeloComboExtiende();
        cmbExtiende.setModel(modeloCombo10);
        
        cmbExtiende.setSelectedItem(null);
        cmbImplementa.setSelectedItem(null);
        cmbTipoAtributo.setSelectedItem(null);
        cmbTipoAtributoTipo.setSelectedItem(null);
        cmbTipoClaseTipo.setSelectedItem(null);
        cmbTipoListaAtributo.setSelectedItem(null);
        cmbTipoListaParametro.setSelectedItem(null);
        cmbTipoMetodo.setSelectedItem(null);
        cmbTipoParametro.setSelectedItem(null);
        cmbTipoRetornoLista.setSelectedItem(null);
        cmbTipoRetornoMetodo.setSelectedItem(null);
        
        AtributosTableModel atributos = new AtributosTableModel();
        tblAtributos.setModel(atributos);
        Controladora.getInstance().setAtributos(atributos);
        ExtiendeTableModel extiende = new ExtiendeTableModel();
        tblExtiende.setModel(extiende);
        Controladora.getInstance().setExtiende(extiende);
        ImplementaTableModel implementa = new ImplementaTableModel();
        tblImplementa.setModel(implementa);
        Controladora.getInstance().setImplemena(implementa);
        MetodosTableModel metodos = new MetodosTableModel();
        tblMetodos.setModel(metodos);
        Controladora.getInstance().setMetodos(metodos);
        ParametrosTableModel parametros = new ParametrosTableModel("");
        tblParametros.setModel(parametros);
        Controladora.getInstance().setParametrosMetodos(parametros);
        rbtnBase.setSelected(true);
        rbtnSingleton.setSelected(false);
        AgregarImplementa.setEnabled(true);
        cmbImplementa.setEnabled(true);
    }
private void btnAgregarAtributoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarAtributoActionPerformed
    if (!txtNombreAtributo.getText().equals("") && cmbTipoAtributo.getSelectedItem() != null && cmbTipoAtributoTipo.getSelectedItem() != null) {
        Atributo atributo = new Atributo();
        atributo.setNombre(txtNombreAtributo.getText());
        atributo.setTipoAtributo(cmbTipoAtributo.getSelectedItem().toString());
        if (cmbTipoAtributoTipo.getSelectedItem().toString().equals("List")) {
            if (cmbTipoListaAtributo.getSelectedItem() != null) {
                atributo.setTipo("List<" + cmbTipoListaAtributo.getSelectedItem().toString() + ">");
            }
        } else {
            atributo.setTipo(cmbTipoAtributoTipo.getSelectedItem().toString());
        }
        
        Controladora.getInstance().getCreadoraClase().setAtributos(atributo);
        txtNombreAtributo.setText("");
        cmbTipoAtributo.setSelectedItem(null);
        cmbTipoAtributoTipo.setSelectedItem(null);
        cmbTipoListaAtributo.setSelectedItem(null);
        cmbTipoListaAtributo.setVisible(false);
        lblTipoLista.setVisible(false);
    }
}//GEN-LAST:event_btnAgregarAtributoActionPerformed
    
private void AgregarExtiendeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AgregarExtiendeActionPerformed
    if (cmbExtiende.getSelectedItem() != null) {
        if (cmbTipoClaseTipo.getSelectedItem() != null) {
            if (cmbTipoClaseTipo.getSelectedItem().toString().equals("class")) {
                if (Controladora.getInstance().getCreadoraClase().getClase().getExtiende().size() < 1) {
                    Controladora.getInstance().getCreadoraClase().getClase().setExtiende(cmbExtiende.getSelectedItem().toString());
                }
            } else if (cmbTipoClaseTipo.getSelectedItem().toString().equals("abstract")) {
                if (Controladora.getInstance().getCreadoraClase().getClase().getExtiende().size() < 1) {
                    Controladora.getInstance().getCreadoraClase().getClase().setExtiende(cmbExtiende.getSelectedItem().toString());
                }
            } else {
                if (Controladora.getInstance().getCreadoraClase().getClase().getExtiende().size() < 1) {
                    Controladora.getInstance().getCreadoraClase().getClase().setExtiende(cmbExtiende.getSelectedItem().toString());
                }
            }
        }
    }
}//GEN-LAST:event_AgregarExtiendeActionPerformed
    
private void cmbTipoClaseTipoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbTipoClaseTipoItemStateChanged
    if (cmbTipoClaseTipo.getSelectedItem() != null) {
        if (cmbTipoClaseTipo.getSelectedItem().toString().equals("interface")) {
            btnAgregarAtributo.setEnabled(false);
            cmbTipoAtributo.setEnabled(false);
            cmbTipoAtributoTipo.setEnabled(false);
            cmbTipoListaAtributo.setEnabled(false);
            txtNombreAtributo.setEnabled(false);
            cmbImplementa.setSelectedItem(null);
            cmbImplementa.setEnabled(false);
            AgregarImplementa.setEnabled(false);
            ModeloComboImplementa modelo = new ModeloComboImplementa();
            cmbExtiende.setModel(modelo);
        } else {
            txtNombreAtributo.setEnabled(true);
            btnAgregarAtributo.setEnabled(true);
            cmbTipoAtributo.setEnabled(true);
            cmbTipoAtributoTipo.setEnabled(true);
            cmbTipoListaAtributo.setEnabled(true);
            cmbImplementa.setSelectedItem(null);
            cmbImplementa.setEnabled(true);
            AgregarImplementa.setEnabled(true);
            ModeloComboExtiende modelo = new ModeloComboExtiende();
            cmbExtiende.setModel(modelo);
        }
    }
}//GEN-LAST:event_cmbTipoClaseTipoItemStateChanged
    
private void AgregarImplementaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AgregarImplementaActionPerformed
    if (cmbImplementa.getSelectedItem() != null) {
        if (cmbTipoClaseTipo.getSelectedItem() != null) {
            if (cmbTipoClaseTipo.getSelectedItem().toString().equals("class")) {
                Controladora.getInstance().getCreadoraClase().getClase().setImplementa(cmbImplementa.getSelectedItem().toString());
            } else if (cmbTipoClaseTipo.getSelectedItem().toString().equals("abstract")) {
                Controladora.getInstance().getCreadoraClase().getClase().setImplementa(cmbImplementa.getSelectedItem().toString());
            }
        }
    }
}//GEN-LAST:event_AgregarImplementaActionPerformed
    
private void cmbTipoClaseTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbTipoClaseTipoActionPerformed
    // TODO add your handling code here:
}//GEN-LAST:event_cmbTipoClaseTipoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                    
                    
                    
                    
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(GeneradorDescktop.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(GeneradorDescktop.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(GeneradorDescktop.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GeneradorDescktop.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            
            public void run() {
                try {
                    new GeneradorDescktop().setVisible(true);
                    
                    
                    
                    
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(GeneradorDescktop.class.getName()).log(Level.SEVERE, null, ex);
                }
                
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AgregarExtiende;
    private javax.swing.JButton AgregarImplementa;
    private javax.swing.JButton btnAgregarAtributo;
    private javax.swing.JButton btnAgregarClase;
    private javax.swing.JButton btnAgregarMetodo;
    private javax.swing.JButton btnAgregarParametro;
    private javax.swing.JButton btnNuevaClase;
    private javax.swing.JComboBox cmbExtiende;
    private javax.swing.JComboBox cmbImplementa;
    private javax.swing.JComboBox cmbTipoAtributo;
    private javax.swing.JComboBox cmbTipoAtributoTipo;
    private javax.swing.JComboBox cmbTipoClaseTipo;
    private javax.swing.JComboBox cmbTipoListaAtributo;
    private javax.swing.JComboBox cmbTipoListaParametro;
    private javax.swing.JComboBox cmbTipoMetodo;
    private javax.swing.JComboBox cmbTipoParametro;
    private javax.swing.JComboBox cmbTipoRetornoLista;
    private javax.swing.JComboBox cmbTipoRetornoMetodo;
    private javax.swing.JMenu jAbrir;
    private javax.swing.JPanel jAtributo;
    private javax.swing.JPanel jClase;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jMetodos;
    private javax.swing.JMenu jNuevo;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JMenuItem jmiNuevoProyecto;
    private javax.swing.JTabbedPane jtpMenu;
    private javax.swing.JLabel lblExtiendeClase;
    private javax.swing.JLabel lblImplementaClase;
    private javax.swing.JLabel lblNombreAtributo1;
    private javax.swing.JLabel lblNombreClase;
    private javax.swing.JLabel lblNombreMetodo;
    private javax.swing.JLabel lblNombreMetodo2;
    private javax.swing.JLabel lblNombreMetodo3;
    private javax.swing.JLabel lblNombreParametro;
    private javax.swing.JLabel lblNombreProyecto;
    private javax.swing.JLabel lblNombreProyecto1;
    private javax.swing.JLabel lblPublic;
    private javax.swing.JLabel lblTIpoClase;
    private javax.swing.JLabel lblTIpoClase1;
    private javax.swing.JLabel lblTipo;
    private javax.swing.JLabel lblTipo1;
    private javax.swing.JLabel lblTipoLista;
    private javax.swing.JLabel lblTipoParametro;
    private javax.swing.JLabel lbltipoListaParametro;
    private javax.swing.JLabel lbltipoListaTipoRetorno;
    private javax.swing.JRadioButton rbtnAbstract;
    private javax.swing.JRadioButton rbtnBase;
    private javax.swing.JRadioButton rbtnQuitarMetodo;
    private javax.swing.JRadioButton rbtnSingleton;
    private javax.swing.JSeparator sepMetodos;
    private javax.swing.JTable tblAtributos;
    private javax.swing.JTable tblExtiende;
    private javax.swing.JTable tblImplementa;
    private javax.swing.JTable tblMetodos;
    private javax.swing.JTable tblParametros;
    private javax.swing.JTextField txtNombreAtributo;
    private javax.swing.JTextField txtNombreClase;
    private javax.swing.JTextField txtNombreMetodo;
    private javax.swing.JTextField txtNombreParametro;
    // End of variables declaration//GEN-END:variables
}
